package com.example.pattern.prototype;

/**
 * 应用
 *
 * @author FM_南风
 * @date 2024/6/23
 */
public class PrototypeClient {
 public static void main(String[] args) {
  Shape rectangle = new Rectangle();
  Shape circle = new Circle();

  // 使用原型对象创建新对象
  Shape clonedRectangle = rectangle.clone();
  Shape clonedCircle = circle.clone();

  System.out.println(clonedRectangle.getType());
  System.out.println(clonedCircle.getType());
 }
}
